using System;

namespace GomokuGame.AI
{
    /// <summary>
    /// AI工厂类
    /// </summary>
    public static class AIFactory
    {
        /// <summary>
        /// 创建指定难度的AI算法
        /// </summary>
        /// <param name="difficulty">AI难度</param>
        /// <returns>AI算法实例</returns>
        public static IAIAlgorithm CreateAI(AIDifficulty difficulty)
        {
            switch (difficulty)
            {
                case AIDifficulty.Beginner:
                    return new BeginnerAI();
                case AIDifficulty.Intermediate:
                    return new IntermediateAI();
                case AIDifficulty.Advanced:
                    return new AdvancedAI();
                case AIDifficulty.Expert:
                    return new ExpertAI();
                default:
                    throw new ArgumentException($"不支持的AI难度: {difficulty}");
            }
        }

        /// <summary>
        /// 获取AI难度名称
        /// </summary>
        /// <param name="difficulty">AI难度</param>
        /// <returns>难度名称</returns>
        public static string GetDifficultyName(AIDifficulty difficulty)
        {
            switch (difficulty)
            {
                case AIDifficulty.Beginner:
                    return "初级";
                case AIDifficulty.Intermediate:
                    return "中级";
                case AIDifficulty.Advanced:
                    return "高级";
                case AIDifficulty.Expert:
                    return "专家";
                default:
                    return "未知";
            }
        }

        /// <summary>
        /// 获取AI难度描述
        /// </summary>
        /// <param name="difficulty">AI难度</param>
        /// <returns>难度描述</returns>
        public static string GetDifficultyDescription(AIDifficulty difficulty)
        {
            switch (difficulty)
            {
                case AIDifficulty.Beginner:
                    return "随机落子，适合初学者";
                case AIDifficulty.Intermediate:
                    return "基础策略，有一定挑战性";
                case AIDifficulty.Advanced:
                    return "Alpha-Beta剪枝算法，具有较强实力";
                case AIDifficulty.Expert:
                    return "深度学习模型，最高难度";
                default:
                    return "未知难度";
            }
        }
    }
} 